import { createApp } from "vue";
import { createPinia } from "pinia";
// pinin持久化存储插件
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

import App from "./App.vue";
import router from "./router";
// 全局指令注册
import { lazyPlugin } from "@/directives/index";
// 引入全局组件插件
import { componentPlugin } from "@/components/index";

import "@/styles/common.scss";
const app = createApp(App);
// 注册 pinia
const pinia = createPinia();
// 注册持久化插件
pinia.use(piniaPluginPersistedstate);
// 全局注册懒加载指令
app.use(lazyPlugin);
app.use(componentPlugin);
app.use(router);
app.use(pinia).mount("#app");
